package com.mmy.service.impl.hotel;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mmy.dao.hotel.THotelPlanRepository;
import com.mmy.domain.hotel.THotelPlan;
import com.mmy.service.hotel.THotelPlanService;

@Service
public class THotelPlanServiceImpl implements THotelPlanService {
	@Autowired
	private THotelPlanRepository tHotelPlanRepository;

	/**
	 * 获取计划单最大编码
	 * 
	 * @return 返回值说明 计划单编码
	 * @author 创建人 dingxd
	 * @date 创建日期 2020.11.16
	 */
	public String getMaxPlanID() {
		// 返回计划单最大编码
		Object objCode = tHotelPlanRepository.getMaxPlanID();
		String strPlanID = "";
		if (objCode != null) {
			strPlanID = objCode.toString();
		}
		return strPlanID;
	}

	/* 创建酒店计划 */
	public void save(int planID) {
		// TODO Auto-generated method stub
		tHotelPlanRepository.save(planID);
	}

	/* 创建修改酒店计划 */
	public void save(THotelPlan tHotelPlan) {
		// TODO Auto-generated method stub
		tHotelPlanRepository.save(tHotelPlan);
	}

	/* 通过计划编码查询 */
	public THotelPlan findByPlanID(int planID) {
		// TODO Auto-generated method stub
		return tHotelPlanRepository.findByPlanID(planID);
	}

	/* 删除酒店计划 */
	public void delHotelPlan(List<Integer> lstPlanID) {
		// TODO Auto-generated method stub
		tHotelPlanRepository.delHotelPlan(lstPlanID);
	}

}
